def pattern_matching(pattern, genome):
    positions = []
    size = len(pattern)
    for i in range(len(genome)-size):
        if genome[i:i+size] == pattern:
            positions.append(i)
    return positions


if __name__ == "__main__":
    lines = open("dataset_3_5.txt").readlines()
    pattern, genome = lines[0].replace("\n", ""), lines[1].replace("\n", "")

    pattern, genome = "AA", "AAACATAGGATCAAC"
    positions = pattern_matching(pattern, genome)

    print(" ".join([str(i) for i in positions]))